import 'package:flutter_easyloading/flutter_easyloading.dart';

class Tips {
  static void showLoading() {
    EasyLoading.instance.userInteractions = false;
    EasyLoading.show();
  }

  static void dismissLoading() {
    if(EasyLoading.isShow) {
      EasyLoading.dismiss();
      EasyLoading.instance.userInteractions = true;
    }

  }

  static void showMessage(String message) {
    EasyLoading.showToast(message);
  }

  static void dismiss() {
    EasyLoading.dismiss();
  }

  static void showToast(String msg) {
    EasyLoading.showToast(msg, toastPosition: EasyLoadingToastPosition.center);
  }
  static void showToast1(String msg, EasyLoadingToastPosition toastPosition, Duration? duration,) {
    EasyLoading.showToast(msg, toastPosition: toastPosition, duration: duration);
  }

  static void dismissLoading2() {
    EasyLoading.dismiss();
    EasyLoading.instance.userInteractions = true;
  }

}
